#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QDomDocument>
#include <QDomNodeList>
#include <QVector>
#include <QStringList>
#include <QThread>
#include <QFile>
#include <QDir>
#include <QDebug>
#include <QMessageBox>
#include <QTextCodec>
#include "domnodelist.h"
#include "common.h"
class Controller: public QThread
{
    Q_OBJECT
private:
    QDomDocument doc;
    DomNodeList allShapes;
    void parseSVG(QByteArray);
    QByteArray getResultSVG(QVector<QStringList>);
public:
    Controller(){}
    Controller(QByteArray image){parseSVG(image);}
    QVector<QStringList> getAllShapes(void);
protected:
    void run();
public slots:
    void onShapeSelected(uint index);
    void onOpenFile(QString);
    void onSaveFile(QString,QVector<QStringList>);
    void onCloseFile(void);
signals:
    void sendShapes(QVector<QStringList>);
    void redrawImage(QByteArray);
};

#endif // PARCER_H
